package org.zoomdev.zoom.dao.driver;

import org.zoomdev.zoom.dao.Record;

import java.util.List;

/**
 * sql语句部分
 */
public abstract class SqlDriver {

    /**
     * 保护关键字
     *
     * @param sb
     * @param name
     * @return
     */
    public abstract StringBuilder protect(StringBuilder sb, String name);


    /**
     * 从url获取数据库名称
     *
     * @param url
     * @return
     */
    public abstract String getDatabaseName(String url);


    public abstract void buildLimit(StringBuilder sql, List<Object> values, int position, int size);

    public abstract void insertOrUpdate(StringBuilder sql, List<Object> values, String table, Record record, String[] keys);
}